-
-
Notifications
You must be signed in to change notification settings - Fork 489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend ElasticSearch proxy to filter out elements defined in the schema filters configurations #6869
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ormation from the query response
…out the xml elements
josegar74
changed the title
Extend ElasticSearch proxy to filtered out elements with the withheld attribute
Extend ElasticSearch proxy to filter out elements with the withheld attribute
Feb 27, 2023
josegar74
changed the title
Extend ElasticSearch proxy to filter out elements with the withheld attribute
Extend ElasticSearch proxy to filter out elements defined in the schema filters configurations
Feb 27, 2023
SonarCloud Quality Gate failed. |
…he documentStandard field to check the schema config.
…Add nilReason for links (and not only contact).
fxprunayre
added
the
index structure change
Indicate that this work introduces an index change.
label
Jun 6, 2023
SonarCloud Quality Gate failed. |
fxprunayre
approved these changes
Aug 30, 2023
fxprunayre
added a commit
to geonetwork/geonetwork-microservices
that referenced
this pull request
Aug 30, 2023
Added by geonetwork/core-geonetwork#6869 (review) Error was: ``` 29/8/2023 19:28:02com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "nilReason" (class org.fao.geonet.index.model.gn.Link), not marked as ignorable (8 known properties: "protocol", "applicationProfile", "nameObject", "descriptionObject", "mimeType", "group", "function", "urlObject"]) 29/8/2023 19:28:02 at [Source: (StringReader); line: 1, column: 34563] (through reference chain: org.fao.geonet.index.model.gn.IndexRecord["link"]->java.util.ArrayList[0]->org.fao.geonet.index.model.gn.Link["nilReason"]) ```
juanluisrp
pushed a commit
to geonetwork/geonetwork-microservices
that referenced
this pull request
Aug 30, 2023
Added by geonetwork/core-geonetwork#6869 (review) Error was: ``` 29/8/2023 19:28:02com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "nilReason" (class org.fao.geonet.index.model.gn.Link), not marked as ignorable (8 known properties: "protocol", "applicationProfile", "nameObject", "descriptionObject", "mimeType", "group", "function", "urlObject"]) 29/8/2023 19:28:02 at [Source: (StringReader); line: 1, column: 34563] (through reference chain: org.fao.geonet.index.model.gn.IndexRecord["link"]->java.util.ArrayList[0]->org.fao.geonet.index.model.gn.Link["nilReason"]) ```
10 tasks
The backport to
stderr
stdout
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-4.2.x 4.2.x
# Navigate to the new working tree
cd .worktrees/backport-4.2.x
# Create a new branch
git switch --create backport-6869-to-4.2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick a47252687f880e76990db2b15a8eb5a6716f5423,397375b6786d5203361c61557cfa52599ff89ffe,ee514705544848ec0bdfc6aaca5763b90f497e20,e0cb16ba6184bdd1508bd8c278b0dd5855e707f9,0764c53802dd231cd530f688601ca6f50b843011,8de81d595f003cfab36496cbdc48d549804d6a25
# Push it to GitHub
git push --set-upstream origin backport-6869-to-4.2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-4.2.x Then, create a pull request where the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backport 4.2.x
failed backport
index structure change
Indicate that this work introduces an index change.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently the metadata schemas allow to define filters defined in
schema-ident.xml
file, to remove certain information from the metadata documents if certain conditions apply.For example in
iso19139
, if the user has no editing permission the elements with the attribute@gco:nilReason='withheld'
are removed from the XML output and the full view formatter:core-geonetwork/schemas/iso19139/src/main/plugin/iso19139/schema-ident.xml
Lines 86 to 90 in fdd7536
The attribute
@gco:nilReason='withheld'
should be added inupdate-fixed-info.xsl
process of each metadata schema to mark which elements should be removed. A typical usage is to remove certain type of contacts for users that can't not edit the metadata record.This pull request extends this support to filter out these elements from the ElasticSearch response. The indexing process has to be extended to handle the
@gco:nilReason='withheld'
for the related ElasticSearch fields (these fields should be object fields). An example for contacts is part of the pull request:https://github.com/geonetwork/core-geonetwork/compare/withheld-es?expand=1#diff-e5443fc6e8489ecc9eb314b5c9f9a3e2e9c4bb0c85888bade22d731edf0f08ea
A new type of operation has been added (
authenticated
) to allow to remove information only for non-authenticated users. For example, if defined the following inschema-ident.xml
file, the elements with@gco:nilReason='withheld'
will be removed for non authenticated users that can view the metadata, but will be preserved for authenticated users that can view the metadata :